-
Notifications
You must be signed in to change notification settings - Fork 2
feat(save_and_load): add import/export methods #249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: next
Are you sure you want to change the base?
Conversation
…persistence create project manager plugin for import/export operations update tests for new functionality and async loading
…ns/OpenGeodeWeb-Front into feat/save_and_load
…b-Front into feat/save_and_load
…ns/OpenGeodeWeb-Front into feat/save_and_load
…ns/OpenGeodeWeb-Front into feat/save_and_load
…ns/OpenGeodeWeb-Front into feat/save_and_load
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JulienChampagnol que penses tu de cette proposition ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| default: vi.fn(() => Promise.resolve({})), |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| viewer_call: vi.fn(() => Promise.resolve({})), |
reported by reviewdog 🐶
Do not use Array#forEach
| .forEach((store) => stores.app.registerStore(store)) |
reported by reviewdog 🐶
Do not use null literals
| selectedTree: null, |
reported by reviewdog 🐶
Expected { after 'if' condition.
| hybridViewerStoreMock.setZScaling(snapshot.zScale) |
reported by reviewdog 🐶
Expected { after 'if' condition.
| if (options.response_function) await options.response_function(response) |
reported by reviewdog 🐶
Expected !== and instead saw !=
| if (snapshot?.zScale != null) |
reported by reviewdog 🐶
Identifier name is too short (< 2).
| color: { r: 255, g: 255, b: 255 }, |
reported by reviewdog 🐶
Identifier name is too short (< 2).
| color: { r: 255, g: 255, b: 255 }, |
reported by reviewdog 🐶
Identifier name is too short (< 2).
| color: { r: 255, g: 255, b: 255 }, |
reported by reviewdog 🐶
Identifier name is too short (< 2).
| get: (k) => (k === "new-file-name" ? "project_123.zip" : null), |
reported by reviewdog 🐶
Identifier name is too short (< 2).
| (v) => typeof v === "function" && v.mockClear && v.mockClear(), |
reported by reviewdog 🐶
The function has too many lines (85). Maximum allowed is 50.
| describe("ProjectManager composable (compact)", () => { |
reported by reviewdog 🐶
The async function has too many lines (52). Maximum allowed is 50.
| test("importProjectFile with snapshot", async () => { |
reported by reviewdog 🐶
Do not use null comparisons without type-checking operators.
| if (snapshot?.zScale != null) |
reported by reviewdog 🐶
1
| focal_point: [1, 2, 3], |
reported by reviewdog 🐶
2
| focal_point: [1, 2, 3], |
reported by reviewdog 🐶
3
| focal_point: [1, 2, 3], |
reported by reviewdog 🐶
0
| view_up: [0, 1, 0], |
reported by reviewdog 🐶
1
| view_up: [0, 1, 0], |
reported by reviewdog 🐶
0
| view_up: [0, 1, 0], |
reported by reviewdog 🐶
10
| position: [10, 11, 12], |
reported by reviewdog 🐶
11
| position: [10, 11, 12], |
reported by reviewdog 🐶
12
| position: [10, 11, 12], |
reported by reviewdog 🐶
0.1
| clipping_range: [0.1, 1000], |
reported by reviewdog 🐶
1000
| clipping_range: [0.1, 1000], |
reported by reviewdog 🐶
4
| expect(viewer_call).toHaveBeenCalledTimes(4) |
reported by reviewdog 🐶
1.5
| expect(hybridViewerStoreMock.setZScaling).toHaveBeenCalledWith(1.5) |
reported by reviewdog 🐶
Async function has no 'await' expression.
| vi.fn(async () => ({ snapshot: snapshotMock })), |
reported by reviewdog 🐶
Enforce test and it usage conventions
| test("exportProject", async () => { |
reported by reviewdog 🐶
Enforce test and it usage conventions
| test("importProjectFile with snapshot", async () => { |
reported by reviewdog 🐶
Enforces a maximum number assertion calls in a test body.
| expect(hybridViewerStoreMock.importStores).toHaveBeenCalledWith( |
reported by reviewdog 🐶
Enforces a maximum number assertion calls in a test body.
| expect(hybridViewerStoreMock.setZScaling).toHaveBeenCalledWith(1.5) |
reported by reviewdog 🐶
Enforces a maximum number assertion calls in a test body.
| expect(dataStyleStoreMock.importStores).toHaveBeenCalledWith( |
reported by reviewdog 🐶
Enforces a maximum number assertion calls in a test body.
| expect(dataStyleStoreMock.applyAllStylesFromState).toHaveBeenCalled() |
reported by reviewdog 🐶
Enforces a maximum number assertion calls in a test body.
| expect(dataBaseStoreMock.registerObject).toHaveBeenCalledWith("abc123") |
reported by reviewdog 🐶
Enforces a maximum number assertion calls in a test body.
| expect(dataBaseStoreMock.addItem).toHaveBeenCalledWith( |
reported by reviewdog 🐶
Enforces a maximum number assertion calls in a test body.
| expect(treeviewStoreMock.addItem).toHaveBeenCalledWith( |
reported by reviewdog 🐶
Enforces a maximum number assertion calls in a test body.
| expect(hybridViewerStoreMock.addItem).toHaveBeenCalledWith("abc123") |
reported by reviewdog 🐶
Enforces a maximum number assertion calls in a test body.
| expect(dataStyleStoreMock.addDataStyle).toHaveBeenCalledWith( |
reported by reviewdog 🐶
Enforces a maximum number assertion calls in a test body.
| expect(dataStyleStoreMock.applyDefaultStyle).toHaveBeenCalledWith("abc123") |
reported by reviewdog 🐶
Enforces a maximum number assertion calls in a test body.
| expect(hybridViewerStoreMock.remoteRender).toHaveBeenCalled() |
reported by reviewdog 🐶
Do not use setup or teardown hooks
| beforeEach(async () => { |
reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().
| expect(infraStoreMock.create_connection).toHaveBeenCalled() |
reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().
| expect(fileDownload).toHaveBeenCalled() |
reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().
| expect(infraStoreMock.create_connection).toHaveBeenCalled() |
reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().
| expect(viewerStoreMock.ws_connect).toHaveBeenCalled() |
reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().
| expect(hybridViewerStoreMock.initHybridViewer).toHaveBeenCalled() |
reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().
| expect(dataStyleStoreMock.applyAllStylesFromState).toHaveBeenCalled() |
reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().
| expect(hybridViewerStoreMock.remoteRender).toHaveBeenCalled() |
reported by reviewdog 🐶
Enforce lowercase test names
| describe("ProjectManager composable (compact)", () => { |
reported by reviewdog 🐶
async is not allowed
| importStores: vi.fn(async (snapshot) => { |
reported by reviewdog 🐶
async is not allowed
| vi.fn(async () => ({ snapshot: snapshotMock })), |
reported by reviewdog 🐶
async is not allowed
| api_fetch: vi.fn(async (_req, options = {}) => { |
reported by reviewdog 🐶
async is not allowed
| beforeEach(async () => { |
reported by reviewdog 🐶
async is not allowed
| test("exportProject", async () => { |
reported by reviewdog 🐶
async is not allowed
| test("importProjectFile with snapshot", async () => { |
reported by reviewdog 🐶
Optional chaining is not allowed.
| if (snapshot?.zScale != null) |
reported by reviewdog 🐶
Optional chaining is not allowed.
| if (snapshot?.camera_options) { |
reported by reviewdog 🐶
Expected catch or return
| const infraStoreMock = { create_connection: vi.fn(() => Promise.resolve()) } |
reported by reviewdog 🐶
Expected catch or return
| const viewerStoreMock = { ws_connect: vi.fn(() => Promise.resolve()) } |
reported by reviewdog 🐶
Expected catch or return
| importStores: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Expected catch or return
| addItem: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Expected catch or return
| registerObject: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Expected catch or return
| addItem: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Expected catch or return
| importStores: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Expected catch or return
| applyAllStylesFromState: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Expected catch or return
| addDataStyle: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Expected catch or return
| applyDefaultStyle: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Expected catch or return
| initHybridViewer: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Expected catch or return
| addItem: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Expected catch or return
| viewer_call: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| const infraStoreMock = { create_connection: vi.fn(() => Promise.resolve()) } |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| const viewerStoreMock = { ws_connect: vi.fn(() => Promise.resolve()) } |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| importStores: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| addItem: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| registerObject: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| addItem: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| importStores: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| applyAllStylesFromState: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| addDataStyle: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| applyDefaultStyle: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| initHybridViewer: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| addItem: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| viewer_call: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Do not use Array#forEach
| Object.values(store).forEach( |
reported by reviewdog 🐶
Do not use null literals
| selectedTree: null, |
reported by reviewdog 🐶
Do not use null literals
| vertex: null, |
reported by reviewdog 🐶
Do not use null literals
| if (snapshot?.zScale != null) |
reported by reviewdog 🐶
Do not use null literals
| get: (k) => (k === "new-file-name" ? "project_123.zip" : null), |
|
|
||
| treeviewStore.isImporting = true | ||
|
|
||
| return Promise.resolve() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Avoid nesting promises.
|
|
||
| treeviewStore.isImporting = true | ||
|
|
||
| return Promise.resolve() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Avoid nesting promises.
|
|
||
| treeviewStore.isImporting = true | ||
|
|
||
| return Promise.resolve() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Avoid nesting promises.
|
|
||
| treeviewStore.isImporting = true | ||
|
|
||
| return Promise.resolve() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Avoid nesting promises.
|
|
||
| treeviewStore.isImporting = true | ||
|
|
||
| return Promise.resolve() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Avoid nesting promises.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
reported by reviewdog 🐶
0
| view_up: [0, 1, 0], |
reported by reviewdog 🐶
10
| position: [10, 11, 12], |
reported by reviewdog 🐶
11
| position: [10, 11, 12], |
reported by reviewdog 🐶
12
| position: [10, 11, 12], |
reported by reviewdog 🐶
0.1
| clipping_range: [0.1, 1000], |
reported by reviewdog 🐶
1000
| clipping_range: [0.1, 1000], |
reported by reviewdog 🐶
4
| expect(viewer_call).toHaveBeenCalledTimes(4) |
reported by reviewdog 🐶
1.5
| expect(hybridViewerStoreMock.setZScaling).toHaveBeenCalledWith(1.5) |
reported by reviewdog 🐶
Async function has no 'await' expression.
| vi.fn(async () => ({ snapshot: snapshotMock })), |
reported by reviewdog 🐶
Enforce test and it usage conventions
| test("exportProject", async () => { |
reported by reviewdog 🐶
Enforce test and it usage conventions
| test("importProjectFile with snapshot", async () => { |
reported by reviewdog 🐶
Enforces a maximum number assertion calls in a test body.
| expect(hybridViewerStoreMock.importStores).toHaveBeenCalledWith( |
reported by reviewdog 🐶
Enforces a maximum number assertion calls in a test body.
| expect(hybridViewerStoreMock.setZScaling).toHaveBeenCalledWith(1.5) |
reported by reviewdog 🐶
Enforces a maximum number assertion calls in a test body.
| expect(dataStyleStoreMock.importStores).toHaveBeenCalledWith( |
reported by reviewdog 🐶
Enforces a maximum number assertion calls in a test body.
| expect(dataStyleStoreMock.applyAllStylesFromState).toHaveBeenCalled() |
reported by reviewdog 🐶
Enforces a maximum number assertion calls in a test body.
| expect(dataBaseStoreMock.registerObject).toHaveBeenCalledWith("abc123") |
reported by reviewdog 🐶
Enforces a maximum number assertion calls in a test body.
| expect(dataBaseStoreMock.addItem).toHaveBeenCalledWith( |
reported by reviewdog 🐶
Enforces a maximum number assertion calls in a test body.
| expect(treeviewStoreMock.addItem).toHaveBeenCalledWith( |
reported by reviewdog 🐶
Enforces a maximum number assertion calls in a test body.
| expect(hybridViewerStoreMock.addItem).toHaveBeenCalledWith("abc123") |
reported by reviewdog 🐶
Enforces a maximum number assertion calls in a test body.
| expect(dataStyleStoreMock.addDataStyle).toHaveBeenCalledWith( |
reported by reviewdog 🐶
Enforces a maximum number assertion calls in a test body.
| expect(dataStyleStoreMock.applyDefaultStyle).toHaveBeenCalledWith("abc123") |
reported by reviewdog 🐶
Enforces a maximum number assertion calls in a test body.
| expect(hybridViewerStoreMock.remoteRender).toHaveBeenCalled() |
reported by reviewdog 🐶
Do not use setup or teardown hooks
| beforeEach(async () => { |
reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().
| expect(infraStoreMock.create_connection).toHaveBeenCalled() |
reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().
| expect(fileDownload).toHaveBeenCalled() |
reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().
| expect(infraStoreMock.create_connection).toHaveBeenCalled() |
reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().
| expect(viewerStoreMock.ws_connect).toHaveBeenCalled() |
reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().
| expect(hybridViewerStoreMock.initHybridViewer).toHaveBeenCalled() |
reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().
| expect(dataStyleStoreMock.applyAllStylesFromState).toHaveBeenCalled() |
reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().
| expect(hybridViewerStoreMock.remoteRender).toHaveBeenCalled() |
reported by reviewdog 🐶
Enforce lowercase test names
| describe("ProjectManager composable (compact)", () => { |
reported by reviewdog 🐶
async is not allowed
| importStores: vi.fn(async (snapshot) => { |
reported by reviewdog 🐶
async is not allowed
| vi.fn(async () => ({ snapshot: snapshotMock })), |
reported by reviewdog 🐶
async is not allowed
| api_fetch: vi.fn(async (_req, options = {}) => { |
reported by reviewdog 🐶
async is not allowed
| beforeEach(async () => { |
reported by reviewdog 🐶
async is not allowed
| test("exportProject", async () => { |
reported by reviewdog 🐶
async is not allowed
| test("importProjectFile with snapshot", async () => { |
reported by reviewdog 🐶
Optional chaining is not allowed.
| if (snapshot?.zScale != null) |
reported by reviewdog 🐶
Optional chaining is not allowed.
| if (snapshot?.camera_options) { |
reported by reviewdog 🐶
Expected catch or return
| const infraStoreMock = { create_connection: vi.fn(() => Promise.resolve()) } |
reported by reviewdog 🐶
Expected catch or return
| const viewerStoreMock = { ws_connect: vi.fn(() => Promise.resolve()) } |
reported by reviewdog 🐶
Expected catch or return
| importStores: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Expected catch or return
| addItem: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Expected catch or return
| registerObject: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Expected catch or return
| addItem: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Expected catch or return
| importStores: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Expected catch or return
| applyAllStylesFromState: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Expected catch or return
| addDataStyle: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Expected catch or return
| applyDefaultStyle: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Expected catch or return
| initHybridViewer: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Expected catch or return
| addItem: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Expected catch or return
| viewer_call: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| const infraStoreMock = { create_connection: vi.fn(() => Promise.resolve()) } |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| const viewerStoreMock = { ws_connect: vi.fn(() => Promise.resolve()) } |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| importStores: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| addItem: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| registerObject: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| addItem: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| importStores: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| applyAllStylesFromState: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| addDataStyle: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| applyDefaultStyle: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| initHybridViewer: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| addItem: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| viewer_call: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Do not use Array#forEach
| Object.values(store).forEach( |
reported by reviewdog 🐶
Do not use null literals
| selectedTree: null, |
reported by reviewdog 🐶
Do not use null literals
| vertex: null, |
reported by reviewdog 🐶
Do not use null literals
| if (snapshot?.zScale != null) |
reported by reviewdog 🐶
Do not use null literals
| get: (k) => (k === "new-file-name" ? "project_123.zip" : null), |
| initHybridViewer: vi.fn(() => Promise.resolve()), | ||
| importStores: vi.fn(async (snapshot) => { | ||
| if (snapshot?.zScale != null) | ||
| hybridViewerStoreMock.setZScaling(snapshot.zScale) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Expected { after 'if' condition.
| get: (k) => (k === "new-file-name" ? "project_123.zip" : null), | ||
| }, | ||
| } | ||
| if (options.response_function) await options.response_function(response) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Expected { after 'if' condition.
| clear: vi.fn(), | ||
| initHybridViewer: vi.fn(() => Promise.resolve()), | ||
| importStores: vi.fn(async (snapshot) => { | ||
| if (snapshot?.zScale != null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Expected !== and instead saw !=
| visibility: true, | ||
| coloring: { | ||
| active: "color", | ||
| color: { r: 255, g: 255, b: 255 }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Identifier name is too short (< 2).
| visibility: true, | ||
| coloring: { | ||
| active: "color", | ||
| color: { r: 255, g: 255, b: 255 }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Identifier name is too short (< 2).
| hybridViewer: { | ||
| zScale: 1.5, | ||
| camera_options: { | ||
| focal_point: [1, 2, 3], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
1
| hybridViewer: { | ||
| zScale: 1.5, | ||
| camera_options: { | ||
| focal_point: [1, 2, 3], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
2
| hybridViewer: { | ||
| zScale: 1.5, | ||
| camera_options: { | ||
| focal_point: [1, 2, 3], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
3
| zScale: 1.5, | ||
| camera_options: { | ||
| focal_point: [1, 2, 3], | ||
| view_up: [0, 1, 0], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
0
| zScale: 1.5, | ||
| camera_options: { | ||
| focal_point: [1, 2, 3], | ||
| view_up: [0, 1, 0], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
reported by reviewdog 🐶
Enforce lowercase test names
| describe("ProjectManager composable (compact)", () => { |
reported by reviewdog 🐶
async is not allowed
| importStores: vi.fn(async (snapshot) => { |
reported by reviewdog 🐶
async is not allowed
| vi.fn(async () => ({ snapshot: snapshotMock })), |
reported by reviewdog 🐶
async is not allowed
| api_fetch: vi.fn(async (_req, options = {}) => { |
reported by reviewdog 🐶
async is not allowed
| beforeEach(async () => { |
reported by reviewdog 🐶
async is not allowed
| test("exportProject", async () => { |
reported by reviewdog 🐶
async is not allowed
| test("importProjectFile with snapshot", async () => { |
reported by reviewdog 🐶
Optional chaining is not allowed.
| if (snapshot?.zScale != null) |
reported by reviewdog 🐶
Optional chaining is not allowed.
| if (snapshot?.camera_options) { |
reported by reviewdog 🐶
Expected catch or return
| const infraStoreMock = { create_connection: vi.fn(() => Promise.resolve()) } |
reported by reviewdog 🐶
Expected catch or return
| const viewerStoreMock = { ws_connect: vi.fn(() => Promise.resolve()) } |
reported by reviewdog 🐶
Expected catch or return
| importStores: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Expected catch or return
| addItem: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Expected catch or return
| registerObject: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Expected catch or return
| addItem: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Expected catch or return
| importStores: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Expected catch or return
| applyAllStylesFromState: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Expected catch or return
| addDataStyle: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Expected catch or return
| applyDefaultStyle: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Expected catch or return
| initHybridViewer: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Expected catch or return
| addItem: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Expected catch or return
| viewer_call: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| const infraStoreMock = { create_connection: vi.fn(() => Promise.resolve()) } |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| const viewerStoreMock = { ws_connect: vi.fn(() => Promise.resolve()) } |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| importStores: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| addItem: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| registerObject: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| addItem: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| importStores: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| applyAllStylesFromState: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| addDataStyle: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| applyDefaultStyle: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| initHybridViewer: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| addItem: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| viewer_call: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Do not use Array#forEach
| Object.values(store).forEach( |
reported by reviewdog 🐶
Do not use null literals
| selectedTree: null, |
reported by reviewdog 🐶
Do not use null literals
| vertex: null, |
reported by reviewdog 🐶
Do not use null literals
| if (snapshot?.zScale != null) |
reported by reviewdog 🐶
Do not use null literals
| get: (k) => (k === "new-file-name" ? "project_123.zip" : null), |
| zScale: 1.5, | ||
| camera_options: { | ||
| focal_point: [1, 2, 3], | ||
| view_up: [0, 1, 0], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
0
| camera_options: { | ||
| focal_point: [1, 2, 3], | ||
| view_up: [0, 1, 0], | ||
| position: [10, 11, 12], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
10
| camera_options: { | ||
| focal_point: [1, 2, 3], | ||
| view_up: [0, 1, 0], | ||
| position: [10, 11, 12], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
11
| camera_options: { | ||
| focal_point: [1, 2, 3], | ||
| view_up: [0, 1, 0], | ||
| position: [10, 11, 12], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
12
| view_up: [0, 1, 0], | ||
| position: [10, 11, 12], | ||
| view_angle: 30, | ||
| clipping_range: [0.1, 1000], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
0.1
|
|
||
| const { viewer_call } = await import("@/composables/viewer_call.js") | ||
|
|
||
| expect(infraStoreMock.create_connection).toHaveBeenCalled() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().
| const { viewer_call } = await import("@/composables/viewer_call.js") | ||
|
|
||
| expect(infraStoreMock.create_connection).toHaveBeenCalled() | ||
| expect(viewerStoreMock.ws_connect).toHaveBeenCalled() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().
| expect(treeviewStoreMock.importStores).toHaveBeenCalledWith( | ||
| snapshotMock.treeview, | ||
| ) | ||
| expect(hybridViewerStoreMock.initHybridViewer).toHaveBeenCalled() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().
| expect(dataStyleStoreMock.importStores).toHaveBeenCalledWith( | ||
| snapshotMock.dataStyle, | ||
| ) | ||
| expect(dataStyleStoreMock.applyAllStylesFromState).toHaveBeenCalled() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().
| ) | ||
| expect(dataStyleStoreMock.applyDefaultStyle).toHaveBeenCalledWith("abc123") | ||
|
|
||
| expect(hybridViewerStoreMock.remoteRender).toHaveBeenCalled() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
reported by reviewdog 🐶
Expected catch or return
| applyDefaultStyle: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Expected catch or return
| initHybridViewer: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Expected catch or return
| addItem: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Expected catch or return
| viewer_call: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| const infraStoreMock = { create_connection: vi.fn(() => Promise.resolve()) } |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| const viewerStoreMock = { ws_connect: vi.fn(() => Promise.resolve()) } |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| importStores: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| addItem: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| registerObject: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| addItem: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| importStores: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| applyAllStylesFromState: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| addDataStyle: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| applyDefaultStyle: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| initHybridViewer: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| addItem: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| viewer_call: vi.fn(() => Promise.resolve()), |
reported by reviewdog 🐶
Do not use Array#forEach
| Object.values(store).forEach( |
reported by reviewdog 🐶
Do not use null literals
| selectedTree: null, |
reported by reviewdog 🐶
Do not use null literals
| vertex: null, |
reported by reviewdog 🐶
Do not use null literals
| if (snapshot?.zScale != null) |
reported by reviewdog 🐶
Do not use null literals
| get: (k) => (k === "new-file-name" ? "project_123.zip" : null), |
| exportStores: vi.fn(() => ({ projectName: "mockedProject" })), | ||
| })) | ||
|
|
||
| describe("ProjectManager composable (compact)", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Enforce lowercase test names
| const hybridViewerStoreMock = { | ||
| clear: vi.fn(), | ||
| initHybridViewer: vi.fn(() => Promise.resolve()), | ||
| importStores: vi.fn(async (snapshot) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
async is not allowed
| // Mocks | ||
| vi.stubGlobal( | ||
| "$fetch", | ||
| vi.fn(async () => ({ snapshot: snapshotMock })), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
async is not allowed
| viewer_call: vi.fn(() => Promise.resolve()), | ||
| })) | ||
| vi.mock("@/composables/api_fetch.js", () => ({ | ||
| api_fetch: vi.fn(async (_req, options = {}) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
async is not allowed
| })) | ||
|
|
||
| describe("ProjectManager composable (compact)", () => { | ||
| beforeEach(async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
async is not allowed
| } | ||
| const dataBaseStoreMock = { | ||
| clear: vi.fn(), | ||
| registerObject: vi.fn(() => Promise.resolve()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Expected catch or return
| const dataBaseStoreMock = { | ||
| clear: vi.fn(), | ||
| registerObject: vi.fn(() => Promise.resolve()), | ||
| addItem: vi.fn(() => Promise.resolve()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Expected catch or return
| addItem: vi.fn(() => Promise.resolve()), | ||
| } | ||
| const dataStyleStoreMock = { | ||
| importStores: vi.fn(() => Promise.resolve()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Expected catch or return
| } | ||
| const dataStyleStoreMock = { | ||
| importStores: vi.fn(() => Promise.resolve()), | ||
| applyAllStylesFromState: vi.fn(() => Promise.resolve()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Expected catch or return
| const dataStyleStoreMock = { | ||
| importStores: vi.fn(() => Promise.resolve()), | ||
| applyAllStylesFromState: vi.fn(() => Promise.resolve()), | ||
| addDataStyle: vi.fn(() => Promise.resolve()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Expected catch or return
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
reported by reviewdog 🐶
Do not use null literals
| selectedTree: null, |
reported by reviewdog 🐶
Do not use null literals
| vertex: null, |
reported by reviewdog 🐶
Do not use null literals
| if (snapshot?.zScale != null) |
reported by reviewdog 🐶
Do not use null literals
| get: (k) => (k === "new-file-name" ? "project_123.zip" : null), |
| hybrid: useHybridViewerStore(), | ||
| } | ||
| Object.values(stores) | ||
| .slice(1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
1
| }) | ||
|
|
||
| describe("Project import", () => { | ||
| test("app.importStores restores stores", async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Enforce test and it usage conventions
| }), | ||
| })) | ||
|
|
||
| beforeEach(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Do not use setup or teardown hooks
| ) | ||
| }) | ||
|
|
||
| describe("Project import", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Enforce lowercase test names
| }), | ||
| })) | ||
|
|
||
| beforeEach(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Require test cases and hooks to be inside a describe block
| importStores: vi.fn(() => Promise.resolve()), | ||
| applyAllStylesFromState: vi.fn(() => Promise.resolve()), | ||
| addDataStyle: vi.fn(() => Promise.resolve()), | ||
| applyDefaultStyle: vi.fn(() => Promise.resolve()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| } | ||
| const hybridViewerStoreMock = { | ||
| clear: vi.fn(), | ||
| initHybridViewer: vi.fn(() => Promise.resolve()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| hybridViewerStoreMock.remoteRender() | ||
| } | ||
| }), | ||
| addItem: vi.fn(() => Promise.resolve()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| vi.fn(async () => ({ snapshot: snapshotMock })), | ||
| ) | ||
| vi.mock("@/composables/viewer_call.js", () => ({ | ||
| viewer_call: vi.fn(() => Promise.resolve()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| dataStyleStoreMock, | ||
| hybridViewerStoreMock, | ||
| ]) { | ||
| Object.values(store).forEach( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Do not use Array#forEach
| function finalizeImportSelection() { | ||
| const ids = pendingSelectionIds.value || [] | ||
| const rebuilt = [] | ||
| if (!ids.length) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Unexpected negated condition.
| components_selection.value = [] | ||
| pendingSelectionIds.value = [] | ||
| model_id.value = "" | ||
| selectedTree.value = undefined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Unexpected use of undefined
| function finalizeImportSelection() { | ||
| const ids = pendingSelectionIds.value || [] | ||
| const rebuilt = [] | ||
| if (!ids.length) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Use .length === 0 when checking length is zero.
| panelWidth: 320, | ||
| model_id: "", | ||
| isTreeCollection: false, | ||
| selectedTree: null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Do not use null literals
| coloring: { | ||
| active: "color", | ||
| color: { r: 255, g: 255, b: 255 }, | ||
| vertex: null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Do not use null literals
| clear: vi.fn(), | ||
| initHybridViewer: vi.fn(() => Promise.resolve()), | ||
| importStores: vi.fn(async (snapshot) => { | ||
| if (snapshot?.zScale != null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Do not use null literals
| const response = { | ||
| _data: new Blob(["zipcontent"], { type: "application/zip" }), | ||
| headers: { | ||
| get: (k) => (k === "new-file-name" ? "project_123.zip" : null), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Do not use null literals
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
reported by reviewdog 🐶
Named exports are not allowed.
| export function useProjectManager() { |
reported by reviewdog 🐶
Prefer named exports
| export default useProjectManager |
reported by reviewdog 🐶
Each then() should return a value or throw
| .then(function () { |
reported by reviewdog 🐶
Avoid nesting promises.
| return Promise.resolve() |
reported by reviewdog 🐶
Avoid nesting promises.
| return Promise.resolve() |
reported by reviewdog 🐶
Avoid nesting promises.
| return Promise.resolve() |
reported by reviewdog 🐶
Avoid nesting promises.
| return Promise.resolve() |
reported by reviewdog 🐶
Avoid nesting promises.
| return Promise.resolve() |
reported by reviewdog 🐶
Avoid nesting promises.
| return Promise.resolve() |
reported by reviewdog 🐶
Avoid nesting promises.
| return Promise.resolve() |
reported by reviewdog 🐶
Avoid nesting promises.
| return Promise.resolve() |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| .then(function () { |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| .then(function (result) { |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| .then(function () { |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| .then(function () { |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| .then(function () { |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| .then(function () { |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| .then(function () { |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| .then(function () { |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| .then(function () { |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| .then(function () { |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| .then(function () { |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| .then(function () { |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| .then(function () { |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| return Promise.resolve() |
| import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json" | ||
| import { once } from "lodash" | ||
|
|
||
| export function useProjectManager() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Expected a function expression.
| const geode = useGeodeStore() | ||
| const appStore = useAppStore() | ||
|
|
||
| const exportProject = function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Unexpected unnamed function.
|
|
||
| return infraStore | ||
| .create_connection() | ||
| .then(function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Unexpected unnamed function.
| return api_fetch( | ||
| { schema, params: { snapshot, filename: defaultName } }, | ||
| { | ||
| response_function: once(function (response) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Unexpected unnamed function.
| }, | ||
| ) | ||
| }) | ||
| .finally(function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Unexpected unnamed function.
| : {} | ||
| const items = Object.entries(snapshotDataBase).map(function (pair) { | ||
| const id = pair[0] | ||
| const item = pair[1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
1
| const binaryLightViewable = | ||
| item && item.vtk_js && item.vtk_js.binary_light_viewable | ||
| ? item.vtk_js.binary_light_viewable | ||
| : undefined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Unexpected use of undefined
| ? snapshot.dataBase.db | ||
| : {} | ||
| const items = Object.entries(snapshotDataBase).map(function (pair) { | ||
| const id = pair[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Use Array destructuring.
| : {} | ||
| const items = Object.entries(snapshotDataBase).map(function (pair) { | ||
| const id = pair[0] | ||
| const item = pair[1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Use Array destructuring.
| import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json" | ||
| import fileDownload from "js-file-download" | ||
| import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json" | ||
| import { once } from "lodash" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Imports should be sorted alphabetically.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| .then(function () { |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| .then(function () { |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| .then(function () { |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| .then(function () { |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| return Promise.resolve() |
reported by reviewdog 🐶
Unexpected block statement surrounding arrow body; move the returned value immediately after the =>.
OpenGeodeWeb-Front/stores/data_style.js
Line 54 in 3d89884
| const setModelEdgesVisibility = (id, visibility) => { |
reported by reviewdog 🐶
Unexpected block statement surrounding arrow body; move the returned value immediately after the =>.
OpenGeodeWeb-Front/stores/data_style.js
Line 58 in 3d89884
| const modelEdgesVisibility = (id) => { |
reported by reviewdog 🐶
Unexpected block statement surrounding arrow body; move the returned value immediately after the =>.
OpenGeodeWeb-Front/stores/data_style.js
Line 62 in 3d89884
| const exportStores = () => { |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/data_style.js
Line 81 in 3d89884
| const objectType = meta?.object_type |
reported by reviewdog 🐶
Each then() should return a value or throw
OpenGeodeWeb-Front/stores/data_style.js
Line 27 in 3d89884
| ]).then(() => { |
reported by reviewdog 🐶
Each then() should return a value or throw
OpenGeodeWeb-Front/stores/data_style.js
Line 33 in 3d89884
| ]).then(() => { |
reported by reviewdog 🐶
Each then() should return a value or throw
OpenGeodeWeb-Front/stores/data_style.js
Line 43 in 3d89884
| return meshStyleStore.applyMeshStyle(id).then(() => { |
reported by reviewdog 🐶
Each then() should return a value or throw
OpenGeodeWeb-Front/stores/data_style.js
Line 47 in 3d89884
| return modelStyleStore.applyModelStyle(id).then(() => { |
reported by reviewdog 🐶
Each then() should return a value or throw
OpenGeodeWeb-Front/stores/data_style.js
Line 89 in 3d89884
| return Promise.all(promises).then(() => { |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
OpenGeodeWeb-Front/stores/data_style.js
Line 25 in 3d89884
| return Promise.all([ |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
OpenGeodeWeb-Front/stores/data_style.js
Line 31 in 3d89884
| return Promise.all([ |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
OpenGeodeWeb-Front/stores/data_style.js
Line 89 in 3d89884
| return Promise.all(promises).then(() => { |
reported by reviewdog 🐶
Wrapping single-element array with Promise.all() is unnecessary.
OpenGeodeWeb-Front/stores/data_style.js
Line 25 in 3d89884
| return Promise.all([ |
reported by reviewdog 🐶
Wrapping single-element array with Promise.all() is unnecessary.
OpenGeodeWeb-Front/stores/data_style.js
Line 31 in 3d89884
| return Promise.all([ |
| const surfaces_defaultColor = { r: 20, g: 20, b: 20 } | ||
| const blocks_defaultVisibility = true | ||
| const blocks_defaultColor = { r: 20, g: 20, b: 20 } | ||
| const blocks_defaultColor = { r: 255, g: 255, b: 255 } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Identifier name is too short (< 2).
| const surfaces_defaultColor = { r: 20, g: 20, b: 20 } | ||
| const blocks_defaultVisibility = true | ||
| const blocks_defaultColor = { r: 20, g: 20, b: 20 } | ||
| const blocks_defaultColor = { r: 255, g: 255, b: 255 } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Identifier name is too short (< 2).
| const surfaces_defaultColor = { r: 20, g: 20, b: 20 } | ||
| const blocks_defaultVisibility = true | ||
| const blocks_defaultColor = { r: 20, g: 20, b: 20 } | ||
| const blocks_defaultColor = { r: 255, g: 255, b: 255 } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Identifier name is too short (< 2).
| import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json" | ||
| import { once } from "lodash" | ||
|
|
||
| export function useProjectManager() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Named exports are not allowed.
| return { exportProject, importProjectFile } | ||
| } | ||
|
|
||
| export default useProjectManager |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Prefer named exports
| .then(function () { | ||
| return viewerStore.ws_connect() | ||
| }) | ||
| .then(function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
|
|
||
| return infraStore | ||
| .create_connection() | ||
| .then(function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| const dataStyleStore = useDataStyleStore() | ||
| return dataStyleStore.importStores(snapshot.dataStyle) | ||
| }) | ||
| .then(function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| .then(function () { | ||
| return hybridViewerStore.importStores(snapshot.hybridViewer) | ||
| }) | ||
| .then(function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
|
|
||
| return importWorkflowFromSnapshot(items) | ||
| }) | ||
| .then(function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
…ns/OpenGeodeWeb-Front into feat/save_and_load
| .then(function () { | ||
| return hybridViewerStore.importStores(snapshot.hybridViewer) | ||
| }) | ||
| .then(function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| .then(function () { | ||
| return hybridViewerStore.initHybridViewer() | ||
| }) | ||
| .then(function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| .then(function () { | ||
| return treeviewStore.importStores(snapshot.treeview) | ||
| }) | ||
| .then(function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| treeviewStore.isImporting = true | ||
|
|
||
| return Promise.resolve() | ||
| .then(function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
|
|
||
| treeviewStore.isImporting = true | ||
|
|
||
| return Promise.resolve() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| const lines_defaultColor = { r: 20, g: 20, b: 20 } | ||
| const surfaces_defaultVisibility = true | ||
| const surfaces_defaultColor = { r: 20, g: 20, b: 20 } | ||
| const surfaces_defaultColor = { r: 255, g: 255, b: 255 } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Identifier name is too short (< 2).
| const lines_defaultColor = { r: 20, g: 20, b: 20 } | ||
| const surfaces_defaultVisibility = true | ||
| const surfaces_defaultColor = { r: 20, g: 20, b: 20 } | ||
| const surfaces_defaultColor = { r: 255, g: 255, b: 255 } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Identifier name is too short (< 2).
| const lines_defaultColor = { r: 20, g: 20, b: 20 } | ||
| const surfaces_defaultVisibility = true | ||
| const surfaces_defaultColor = { r: 20, g: 20, b: 20 } | ||
| const surfaces_defaultColor = { r: 255, g: 255, b: 255 } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Identifier name is too short (< 2).
| function exportStores() { | ||
| const snapshotDb = {} | ||
| for (const [id, item] of Object.entries(db)) { | ||
| if (!item) continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Expected { after 'if' condition.
| return flat_indexes | ||
| } | ||
|
|
||
| function exportStores() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Expected a function expression.
| } | ||
| } | ||
|
|
||
| const setModelEdgesVisibility = (id, visibility) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Unexpected block statement surrounding arrow body; move the returned value immediately after the =>.
| return modelStyleStore.setModelEdgesVisibility(id, visibility) | ||
| } | ||
|
|
||
| const modelEdgesVisibility = (id) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Unexpected block statement surrounding arrow body; move the returned value immediately after the =>.
| return modelStyleStore.modelEdgesVisibility(id) | ||
| } | ||
|
|
||
| const exportStores = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Unexpected block statement surrounding arrow body; move the returned value immediately after the =>.
| const meshStyleStore = useMeshStyle() | ||
| const modelStyleStore = useModelStyle() | ||
| const dataBaseStore = useDataBaseStore() | ||
| const hybridViewerStore = useHybridViewerStore() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Variable 'hybridViewerStore' is declared but never used. Unused variables should start with a '_'.
| const promises = [] | ||
| for (const id of ids) { | ||
| const meta = dataBaseStore.itemMetaDatas(id) | ||
| const objectType = meta?.object_type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Optional chaining is not allowed.
| } | ||
|
|
||
| export { importFile, importWorkflow } | ||
| async function importItemFromSnapshot(item) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Expected a function expression.
| return item.id | ||
| } | ||
|
|
||
| async function importWorkflowFromSnapshot(items) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Expected a function expression.
|
|
||
| const ids = [] | ||
| for (const item of items) { | ||
| const id = await importItemFromSnapshot( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Unexpected await inside a loop.
| } | ||
|
|
||
| async function importWorkflowFromSnapshot(items) { | ||
| console.log("[importWorkflowFromSnapshot] start", { count: items?.length }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Unexpected console statement.
| ids.push(id) | ||
| } | ||
| hybridViewerStore.remoteRender() | ||
| console.log("[importWorkflowFromSnapshot] done", { ids }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Unexpected console statement.
| return ids | ||
| } | ||
|
|
||
| export { importFile, importWorkflow, importWorkflowFromSnapshot } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Named exports are not allowed.
| } | ||
|
|
||
| export { importFile, importWorkflow } | ||
| async function importItemFromSnapshot(item) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
async is not allowed
| return item.id | ||
| } | ||
|
|
||
| async function importWorkflowFromSnapshot(items) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
async is not allowed
| } | ||
|
|
||
| async function importWorkflowFromSnapshot(items) { | ||
| console.log("[importWorkflowFromSnapshot] start", { count: items?.length }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Optional chaining is not allowed.
…persistence
create project manager plugin for import/export operations update tests for new functionality and async loading